﻿using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;

namespace ULSDeobfuscator {

    public class ProgramSettings {

        public ProgramSettings() {

            // default values
            IsDateShown = true;
            IsProcessShown = true;
            IsThreadIdShown = false;
            IsAreaShown = true;
            IsCategoryShown = true;
            IsLevelShown = true;
            IsMessageShown = true;
            IsEventIdShown = false;
            IsCorrelationShown = false;

            MainDateWidth = 140;
            MainEventIdWidth = 100;
            MainLevelWidth = 100;
            MainMessageWidth = 730;
            MainProcessWidth = 150;
            MainThreadIdWidth = 70;
            MainCorrelationWidth = 400;
            MainCategoryWidth = 155;
            MainAreaWidth = 145;

            MainWindowHeight = 900;
            MainWindowWidth = 1500;
            MainWindowLeft = 165;
            MainWindowTop = 60;
            MainWindowState = WindowState.Normal;

            MainTextBoxHeight = 60;

            IsDuplicateRemovalEnabled = true;

            RecentlyOpenedFiles = new List<string>();

            ChooserDayWidth = 77;
            ChooserHostNameWidth = 85;
            ChooserTimeWidth = 70;
            ChooserSizeWidth = 50;
            ChooserOriginalFileWidth = 193;

            ChooserWindowLeft = 100;
            ChooserWindowTop = 100;
            ChooserWindowHeight = 750;
            ChooserWindowWidth = 610;

            RecentlyOpenedDirectories = new List<string>();

            ComplexFilters = new List<ComplexFilter>();

            ComplexFiltersWindowLeft = 500;
            ComplexFiltersWindowTop = 300;
            ComplexFiltersWindowHeight = 300;
            ComplexFiltersWindowWidth = 550;

            ComplexFiltersExpressionWidth = 260;
            ComplexFiltersIsRegexWidth = 72;
            ComplexFiltersIsCaseSensibleWidth = 94;

            EditComplexFilterWindowTop = 530;
            EditComplexFilterWindowLeft = 630;
            EditComplexFilterWindowWidth = 329;
            EditComplexFilterWindowHeight = 249;

            ColorRules = new List<ColorRule>();

            ManageColorRulesWindowLeft = 300;
            ManageColorRulesWindowTop = 100;
            ManageColorRulesWindowHeight = 387;
            ManageColorRulesWindowWidth = 930;

            EditColorRuleWindowLeft = 400;
            EditColorRuleWindowTop = 110;
            EditColorRuleWindowHeight = 850;
            EditColorRuleWindowWidth = 600;

            DefaultForegroundColor = Colors.Black;
            DefaultBackgroundColor = Colors.White;

            HighlightForegroundColor = Colors.Blue;
            HighlightBackgroundColor = Colors.White;

            ManageColorRulesNameWidth = 50;
            ManageColorRulesProcessWidth = 71;
            ManageColorRulesAreaWidth = 66;
            ManageColorRulesCategoryWidth = 80;
            ManageColorRulesLevelWidth = 65;
            ManageColorRulesEventWidth = 83;
            ManageColorRulesMessageWidth = 102;
            ManageColorRulesCorrelationWidth = 81;
            ManageColorRulesMultiLineWidth = 57;
            ManageColorRulesColorWidth = 66;
            ManageColorRulesPersistentWidth = 85;

            RecentSearchMessages = new List<string>();
            RecentSearchFilters = new List<string>();

            // used by 1.12+
            // pre 1.12 has version = 1;
            // 1.12+ has version = 2
            Version = 1;
        }

        public int Version { get; set; }

        public bool IsDateShown { get; set; }

        public bool IsProcessShown { get; set; }

        public bool IsThreadIdShown { get; set; }

        public bool IsAreaShown { get; set; }

        public bool IsCategoryShown { get; set; }

        public bool IsLevelShown { get; set; }

        public bool IsMessageShown { get; set; }

        public bool IsCorrelationShown { get; set; }

        public bool IsEventIdShown { get; set; }

        public double MainDateWidth { get; set; }

        public double MainProcessWidth { get; set; }

        public double MainThreadIdWidth { get; set; }

        public double MainAreaWidth { get; set; }

        public double MainCategoryWidth { get; set; }

        public double MainLevelWidth { get; set; }

        public double MainMessageWidth { get; set; }

        public double MainCorrelationWidth { get; set; }

        public double MainEventIdWidth { get; set; }

        public double MainTextBoxHeight { get; set; }

        public double MainWindowHeight { get; set; }
        public double MainWindowWidth { get; set; }
        public double MainWindowLeft { get; set; }
        public double MainWindowTop { get; set; }

        public bool IsDuplicateRemovalEnabled { get; set; }

        public List<string> RecentlyOpenedFiles { get; set; }

        public double ChooserWindowHeight { get; set; }
        public double ChooserWindowWidth { get; set; }
        public double ChooserWindowLeft { get; set; }
        public double ChooserWindowTop { get; set; }

        public double ChooserHostNameWidth { get; set; }
        public double ChooserDayWidth { get; set; }
        public double ChooserTimeWidth { get; set; }
        public double ChooserSizeWidth { get; set; }
        public double ChooserOriginalFileWidth { get; set; }

        public List<string> RecentlyOpenedDirectories { get; set; }
        public List<string> RecentSearchMessages { get; set; }
        public List<string> RecentSearchFilters { get; set; }

        public List<ComplexFilter> ComplexFilters { get; set; }

        public double ComplexFiltersWindowHeight { get; set; }
        public double ComplexFiltersWindowWidth { get; set; }
        public double ComplexFiltersWindowLeft { get; set; }
        public double ComplexFiltersWindowTop { get; set; }

        public double ComplexFiltersExpressionWidth { get; set; }
        public double ComplexFiltersIsRegexWidth { get; set; }
        public double ComplexFiltersIsCaseSensibleWidth { get; set; }

        public double EditComplexFilterWindowHeight { get; set; }
        public double EditComplexFilterWindowWidth { get; set; }
        public double EditComplexFilterWindowLeft { get; set; }
        public double EditComplexFilterWindowTop { get; set; }

        public WindowState MainWindowState { get; set; }

        public List<ColorRule> ColorRules { get; set; }

        public double ManageColorRulesWindowHeight { get; set; }
        public double ManageColorRulesWindowWidth { get; set; }
        public double ManageColorRulesWindowLeft { get; set; }
        public double ManageColorRulesWindowTop { get; set; }

        public double ManageColorRulesNameWidth { get; set; }
        public double ManageColorRulesProcessWidth { get; set; }
        public double ManageColorRulesAreaWidth { get; set; }
        public double ManageColorRulesCategoryWidth { get; set; }
        public double ManageColorRulesLevelWidth { get; set; }
        public double ManageColorRulesEventWidth { get; set; }
        public double ManageColorRulesMessageWidth { get; set; }
        public double ManageColorRulesCorrelationWidth { get; set; }
        public double ManageColorRulesMultiLineWidth { get; set; }
        public double ManageColorRulesPersistentWidth { get; set; }
        public double ManageColorRulesColorWidth { get; set; }

        public double EditColorRuleWindowHeight { get; set; }
        public double EditColorRuleWindowWidth { get; set; }
        public double EditColorRuleWindowLeft { get; set; }
        public double EditColorRuleWindowTop { get; set; }

        public Color DefaultForegroundColor { get; set; }
        public Color DefaultBackgroundColor { get; set; }
        public Color HighlightForegroundColor { get; set; }
        public Color HighlightBackgroundColor { get; set; }
    }
}